package com.alik.view;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alik.service.UserService;
import com.google.common.collect.Maps;

@Controller("userAction")
@RequestMapping("/user")
public class UserAction {
    @Resource(name = "userService")
    private UserService userService;
    
    @RequestMapping(value = "/save")
    public String saveUser(HttpServletRequest req) {
        HashMap<String, String> inMap = Maps.newHashMap();
        inMap.put("user", "12345");
        inMap.put("uid", "12345");
        inMap.put("password", "12345");
        userService.insert(inMap);
        List<Map> selectUser = userService.selectUser(inMap);
        System.err.println(selectUser);
        return "home";
    }
}
